package com.lb.trac.pojo.condition;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

import com.lb.trac.util.SQLCondition;

public class FindUtentiByIds implements SQLCondition {

	private String[] idUtentis ;
	
	
	public FindUtentiByIds(String[] ids) {
		super();
		this.idUtentis = ids;
	}


	public Criterion create(Object... params) {
		Collection<BigDecimal> ids = new ArrayList<BigDecimal>();
		for (int i = 0; i < idUtentis.length; i++) {
			String object = idUtentis[i];
			ids.add(new BigDecimal(object));
		}
		return Restrictions.in("idUtente", ids);
		
	}

}
